package com.robot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.robot.model.FireAlarm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 火警记录Mapper接口
 */
@Mapper
public interface FireAlarmMapper extends BaseMapper<FireAlarm> {
    
    /**
     * 根据公司、年份和月份查询火警记录
     */
    @Select("SELECT * FROM fire_alarm WHERE company = #{company} AND year = #{year} AND month = #{month}")
    List<FireAlarm> findByCompanyAndYearAndMonth(@Param("company") String company, 
                                            @Param("year") Integer year, 
                                            @Param("month") Integer month);
    
    /**
     * 根据公司和年份查询火警记录
     */
    @Select("SELECT * FROM fire_alarm WHERE company = #{company} AND year = #{year}")
    List<FireAlarm> findByCompanyAndYear(@Param("company") String company, 
                                     @Param("year") Integer year);
} 